def add(a, b=0):  # a:位置参数，写在默认参数前面  b:默认参数，缺省参数，如果有多个默认参数且传参有缺省情况时，则传参调用时，实参要进行指定
    return a + b


result1 = add(3, 5)
result2 = add(3)
print(result1)
print(result1)


def info(name, age=20, gender='男'):
    print("name: %s,age: %d,gender: %s" % (name, age, gender))


info("jack")
info("jack", age=25)
info("jack", gender="女")


def add_all(*args):  # 可变参数，形成元组tuple
    total = 0
    for i in args:
        total += i
    print(total)


add_all(1, 5, 3)
nums = [1, 2, 5, 4]
print(add_all(*nums))


def func(**kwargs):  # 可变参数，形成字典dic
    for key, value in kwargs.items():
        print(key, value, sep="---")


func(**{'name': 'jack', "age": 18})
func(name="hahha", age=48)


def t_return():
    return "abc", 12


r1, r2 = t_return();
print(r1, r2)

a, b, c = 4, 5, 8
print(eval('a+5*b*c'))

eval('print(list(map(lambda x:x+2,[0,0,0])))')
